package com.it.system.course_service.controller;

import com.it.system.course_service.service.CourseOrientationService;
import com.it.system.educommonapi.entity.CourseOrientation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/course-orientations")
public class CourseOrientationController {
    @Autowired
    private CourseOrientationService courseOrientationService;

    @GetMapping
    public List<CourseOrientation> getAllCourseOrientations() {
        return courseOrientationService.getAllCourseOrientations();
    }

    @GetMapping("/parent/{parentId}")
    public List<CourseOrientation> getCourseOrientationsByParentId(@PathVariable long parentId) {
        return courseOrientationService.getCourseOrientationsByParentId(parentId);
    }

    @GetMapping("/{id}")
    public List<CourseOrientation> getSubOrientations(@PathVariable long id) {
        return courseOrientationService.getCourseOrientationsByParentId(id);
    }
} 